package base.factory.framework;

/**
 * @program: DesignPatterns
 * @description: 创建实例的类
 * @author: Mr.Dai
 * @create: 2018-05-07 15:48
 **/
public abstract class Factory {

    public final Product create(String name){
        Product product = createProduct(name);
        registerProduct(product);
        return product;
    }

    protected abstract Product createProduct(String name);
    protected abstract void registerProduct(Product product);
}
